package sadasd;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName interview
 * @Description: TODO
 * @date ${DAT}20:37
 */
public class StringTest {
    public static void main(String[] args) {
        String A = "AAA";
        System.out.println(A.intern() == A);
        String B = new String("AAA");
        System.out.println(A == B);
        String C = "AAA";
        System.out.println(A == C);

        String s1 = new String("1");
        s1.intern();
        String s2 = "1";
        System.out.println(s1 == s2);

        String s3 = new String("1") + new String("1");
        s3.intern();
        String s4 = "11";
        System.out.println(s3 == s4);
    }
}
